<template>
	<view style="background-color: #F7F7F7;">
		<!-- tabs展示主体区域 -->
		<view class="tabsContainer">
			<!-- 1.概览 -->
			<view class="tabsItem tabs1" v-if="projectFinnaceCurrent == '1'">
				<view class="overviewRow">
					<view class="rowTitle">
						<view class="line"></view>
						<view class="titleText">项目费用</view>
					</view>
					<view class="rowBody">
						<view class="rowBodyItem">
							<view class="num">{{ financeIndexData.arrival_today + '元' }}</view>
							<view class="title">
								<!-- 合同金额 -->
								今日到账
							</view>
						</view>
						<view class="rowBodyItem rowBodyItem2">
							<view class="num">{{ financeIndexData.arrival_all + '元' }}</view>
							<view class="title">到账金额</view>
						</view>
						<view class="rowBodyItem rowBodyItem3">
							<view class="num">{{ financeIndexData.expend_all + '元' }}</view>
							<view class="title">
								全部支出
								<!-- 剩余尾款 -->
							</view>
						</view>
					</view>
				</view>
				<view class="overviewRow" style="margin-top: 20rpx;">
					<view class="rowTitle">
						<view class="line"></view>
						<view class="titleText">其他费用</view>
					</view>
					<view class="rowBody">
						<view class="rowBodyItem rowBodyItem4">
							<view class="num">{{ financeIndexData.reimbursement_all + '元' }}</view>
							<view class="title">报销</view>
						</view>
						<view class="rowBodyItem rowBodyItem5">
							<view class="num">{{ financeIndexData.settlement_all + '元' }}</view>
							<view class="title">项目结算</view>
						</view>
						<view class="rowBodyItem rowBodyItem6">
							<view class="num">{{ financeIndexData.expert_all + '元' }}</view>
							<view class="title">项目专家费</view>
						</view>
					</view>
				</view>
			</view>




		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				financeIndexData: {
					arrival_today: '0',
					arrival_all: '0',
					expend_all: '0',
					reimbursement_all: '0',
					settlement_all: '0',
					expert_all: '0',
				},
				token: '',
				member_id: '',
				company_id: '',
				projectFinnaceCurrent: '1',
			};
		},
		onShow() {
			this.token = uni.getStorageSync('btlh_process_token') || '';
			this.member_id = uni.getStorageSync('btlh_process_member_id') || '';
			this.company_id = uni.getStorageSync('bthl_process_LoginCompanyId') || '';
			this.cache_department_id = uni.getStorageSync('cache_department_id') || '';
		},
		onLoad(options) {
			this.token = uni.getStorageSync('btlh_process_token') || '';
			this.member_id = uni.getStorageSync('btlh_process_member_id') || '';
			this.company_id = uni.getStorageSync('bthl_process_LoginCompanyId') || '';
			this.cache_department_id = uni.getStorageSync('cache_department_id') || '';
			this.getFinnaceLook();
		},
		methods: {
			// 获取总览
			async getFinnaceLook() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Finance/index',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,
						cache_department_id: this.cache_department_id,
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				this.financeIndexData = res.datas;
			},
		}
	};
</script>

<style scoped lang="scss">
	// tabs主体区域
	.tabsContainer {
		.tabsItem {
			background-color: #f7f7f7;
			position: relative;

			.finnaceList {

				// height: auto;
				.listItem {
					border-bottom: 4rpx solid #F7F7F7;
					background-color: #fff;
					padding-top: 20rpx;
					padding-bottom: 20rpx;

					.itemTitle {
						width: 100%;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						min-height: 20rpx;
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						padding-top: 35rpx;
						margin-left: 30rpx;
					}

					.itemInfo {
						display: flex;
						justify-content: space-between;
						align-items: center;
						padding-bottom: 30rpx;
						margin-bottom: 5rpx;

						.type {
							width: 220rpx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #999999;
							margin-left: 30rpx;
						}

						.num {
							width: 200rpx;
							font-size: 24rpx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
							font-family: PingFang SC;
							font-weight: 500;
							color: #666666;
						}

						.rightStatus {
							width: 250rpx;
							margin-right: 30rpx;
							text-align: right;
						}
					}
				}
			}
		}

		// 2.报销
		.tabs2 {}

		// 1.概览
		.tabs1 {
			margin-top: 20rpx;

			.overviewRow {
				background-color: #fff;

				.rowTitle {
					height: 102rpx;
					display: flex;
					align-items: center;
					border-bottom: 1px solid #efefef;

					.line {
						width: 6rpx;
						height: 42rpx;
						margin-left: 30rpx;
						margin-right: 23rpx;
						background: #40a0f2;
					}

					.titleText {
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
					}
				}

				.rowBody {
					box-sizing: border-box;
					padding: 0 45rpx;
					padding-top: 26rpx;
					display: flex;
					flex-wrap: wrap;
					justify-content: space-between;

					.rowBodyItem {
						width: 317rpx;
						height: 147rpx;
						background: url(../../static/images/projectfinnal_1.png) no-repeat;
						background-size: 100% 100%;

						.num {
							font-size: 30rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #ffffff;
							margin-top: 33rpx;
							margin-left: 48rpx;
						}

						.title {
							font-size: 26rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #ffffff;
							margin-left: 76rpx;
						}
					}

					.rowBodyItem2 {
						background: url(../../static/images/projectfinnal_2.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem3 {
						margin-top: 13rpx;
						background: url(../../static/images/projectfinnal_3.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem4 {
						background: url(../../static/images/projectfinnal_4.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem5 {
						background: url(../../static/images/projectfinnal_5.png) no-repeat;
						background-size: 100% 100%;
					}

					.rowBodyItem6 {
						margin-top: 13rpx;
						background: url(../../static/images/projectfinnal_6.png) no-repeat;
						background-size: 100% 100%;
					}
				}
			}
		}
	}
</style>
